package com.zhida.common.exchange;

import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;

/**
 * Create by zhh 2024/7/29 10:55
 */
public class LikesExchange {

    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "likes.queue", durable = "true"),
            exchange = @Exchange(name = "zhida.likes", type = ExchangeTypes.DIRECT),
            key = "up"
    ))
    public void LikesListener(String msg){
        System.out.println("LikesListener: " + msg);
    }
}
